package samsung.sds.survey.surveyManagement.controller;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import samsung.sds.survey.surveyManagement.model.SurveyEmailEntity;
import samsung.sds.survey.surveyManagement.service.SurveyEmailService;
import samsung.sds.system.common.model.QueryParam;
import samsung.sds.system.utils.CommonTools;
/**
 * @author pt.fang
 * @createDate:2016-02-23
 * 发送邮件模块控制器
 */
@Controller
@RequestMapping("/survey/surveyManagement/surveyEmail")
public class SurveyEmailController {
	
	@Autowired
	private SurveyEmailService surveyEmailServiceImpl;
	
	/**
	 * 弹出发送邮件窗口
	 */
	@RequestMapping(value = "/popupEmail_sitemesh_popup", method = RequestMethod.GET)
	public String popupEmail_sitemesh_popup(){
		return "/survey/surveyManagement/popupEmail";
	}
	
	/**
	 * 获取邮件信息
	 * @param request
	 * @return
	 */
	@RequestMapping(value = "/getEmailData", method = RequestMethod.POST)
	@ResponseBody
	public List<SurveyEmailEntity> getEmailData(HttpServletRequest request){
		QueryParam param = CommonTools.getQueryParam(request);
		return surveyEmailServiceImpl.queryList(param);
	}
}
